Skip to content

fix(alsa): check PCM RT-safety before promotion#1197

Open
roderickvd wants to merge 2 commits intomasterfrom
fix/alsa-rt-safe-types
Open

fix(alsa): check PCM RT-safety before promotion#1197
roderickvd wants to merge 2 commits intomasterfrom
fix/alsa-rt-safe-types

Conversation

@roderickvd
Copy link
Copy Markdown
Member

This should fix #1193 from the following issue:

When the user's ALSA device routes to PulseAudio through the pcm_pulse plugin, and cpal promotes the ALSA thread to realtime, then the core is dumped with SIGXCPU. The sequence is this:

  1. realtime-dbus promotes the ALSA audio thread to RT via rtkit
  2. rtkit grants SCHED_FIFO priority to that thread while enforcing RLIMIT_RTTIME
  3. libpulse is not RT-safe and either spins or does expensive syscalls from the RT thread, burning through the RLIMIT_RTTIME budget
  4. Kernel fires SIGXCPU and dumps core

This PR implements PCM type whitelisting for types that are RT-safe.

This comment was marked as resolved.

This comment was marked as resolved.

@roderickvd
Copy link
Copy Markdown
Member Author

Note that this disables realtime promotion for pipewire-alsa even though that is RT-safe, unlike pulseaudio-alsa. This errs on the safe side: both are PCM type IOPLUG and we can't distinguish between them further.

Use the dedicated pipewire host and cpal feature flag if you want a realtime thread on PipeWire.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

coredump with default build of current master on Ubuntu 20.04LTS Pro

2 participants